/******************************************************************************/
/* File: udpTrafficServer.h                                                   */
/******************************************************************************/

#ifndef UDPTRAFFICSERVER_H
#define UDPTRAFFICSERVER_H

#include "thread.h"
#include "messageQueue.h"
#include "socketClass.h"
#include "dataStore.h"
#include "udpTrafficRecver.h"

class UDPTrafficServer : public Thread, public UDPServerSocket {

public:
    UDPTrafficServer(TrafficServerSetting *pSet, MessageQueue *pMQ);
    ~UDPTrafficServer();
    
    // socket function wrapper
    void ListenServer();
    void CloseListenSocket();
    UDPConnectedSocket* AcceptClient();
    
    void UploadRegisterInfo();
    void UploadUnregisterInfo();
    
    void ExitCleanUp();
    virtual void Run();
    
protected:
    IPAddress cListenIP;
    int iListenPort;
    bool bUseIPv6;
    
    MessageQueue *pMsgQueue;
    char *mBuf;
};

#endif

/******************************************************************************/
/* End File: udpTrafficServer.h                                               */
/******************************************************************************/